<template>
	<view class="content">
		<view class="salesman disp aic" v-for="item in salesmanList" :key="item.id" @click="tosalesmanDetail(item.id)">
			<image :src="item.avatar" mode=""></image>
			<view class="salesmanMess disc jsb">
				<view class="fw">{{item.name}}</view>
				<view class="tag disp">
					<view class="tagList fz12" v-for="items,indexs in item.customLabel" :key="indexs">{{items}}</view>
				</view>
				<view class="fz12">{{item.remark?item.remark:''}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { getSalesman } from "../../api/index.js"
	export default {
		data() {
			return {
				salesmanList:[]
			};
		},
		onLoad() {
			this.getList()
		},
		methods:{
			tosalesmanDetail(id){
        uni.navigateTo({
          url:`/pages/index/salesmanDetail?id=${id}`
        })
			},
			//获取业务员列表
			getList(){
				getSalesman().then(res => {
					res.data.forEach(v => {
						if(v.customLabel){
							v.customLabel = v.customLabel.split(',')
						}
					})
					this.salesmanList = res.data
				})
			}
		}
	}
</script>

<style lang="scss">
.content{
	padding: 24rpx;
	.salesman{
		margin-bottom: 40rpx;
		image{
			width: 150rpx;
			height: 150rpx;
			border-radius: 10rpx;
			margin-right: 20rpx;
		}
		.salesmanMess{
			height: 150rpx;
			.tag{
				.tagList{
					line-height: 30rpx;
					padding: 4rpx 6rpx;
					margin: 0 10rpx;
          color: #323CDD;
          background-color: #EFEFFD;
          border-radius: 3px;
				}
			}
		}
	}
}
</style>
